package com.ruoyi.sgsc.service.impl;

import java.util.List;

import com.ruoyi.sgsc.domain.orderlist;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sgsc.mapper.orderdetailsMapper;
import com.ruoyi.sgsc.domain.orderdetails;
import com.ruoyi.sgsc.service.IorderdetailsService;

/**
 * 订单详情Service业务层处理
 * 
 * @author wy
 * @date 2024-09-29
 */
@Service
public class orderdetailsServiceImpl implements IorderdetailsService 
{
    @Autowired
    private orderdetailsMapper orderdetailsMapper;

    /**
     * 查询订单详情
     * 
     * @param orderDetailId 订单详情主键
     * @return 订单详情
     */
    @Override
    public orderdetails selectorderdetailsByOrderDetailId(Long orderDetailId)
    {
        return orderdetailsMapper.selectorderdetailsByOrderDetailId(orderDetailId);
    }



    /**
     * 根据userId获取订单列表
     * @param userId
     * @return
     */
    public List<orderlist>  selectorderdetailsByuserId(Long userId)
    {
        return orderdetailsMapper.selectorderdetailsByuserId(userId);
    }

    /**
     * 根据订单id获取订单详情
     * @param orderId
     * @return
     */
    public List<orderlist>  selectorderdetailsByOrderId(Long orderId)
    {
        return orderdetailsMapper.selectorderdetailsByOrderId(orderId);
    }

    /**
     * 查询订单详情列表
     * 
     * @param orderdetails 订单详情
     * @return 订单详情
     */
    @Override
    public List<orderdetails> selectorderdetailsList(orderdetails orderdetails)
    {
        return orderdetailsMapper.selectorderdetailsList(orderdetails);
    }


    /**
     * 新增订单详情
     * 
     * @param orderdetails 订单详情
     * @return 结果
     */
    @Override
    public int insertorderdetails(orderdetails orderdetails)
    {
        return orderdetailsMapper.insertorderdetails(orderdetails);
    }

    /**
     * 修改订单详情
     * 
     * @param orderdetails 订单详情
     * @return 结果
     */
    @Override
    public int updateorderdetails(orderdetails orderdetails)
    {
        return orderdetailsMapper.updateorderdetails(orderdetails);
    }

    /**
     * 批量删除订单详情
     * 
     * @param orderDetailIds 需要删除的订单详情主键
     * @return 结果
     */
    @Override
    public int deleteorderdetailsByOrderDetailIds(Long[] orderDetailIds)
    {
        return orderdetailsMapper.deleteorderdetailsByOrderDetailIds(orderDetailIds);
    }

    /**
     * 删除订单详情信息
     * 
     * @param orderDetailId 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteorderdetailsByOrderDetailId(Long orderDetailId)
    {
        return orderdetailsMapper.deleteorderdetailsByOrderDetailId(orderDetailId);
    }
}
